package com.example.mapstruct.mapper;

import com.example.mapstruct.dto.CarDto;
import com.example.mapstruct.entity.Car;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * @author zjm
 * @date 2018/9/19.
 */
@Mapper(componentModel = "spring")
public interface CarMapper extends EntityConverter<CarDto, Car> {

//  CarMapper INSTANCE = Mappers.getMapper(CarMapper.class);

  @Mapping(source = "numberOfSeats", target = "seatCount")
  CarDto toDto(Car car);
}